//----------------------------------------------------------------------------
// M A R I T I M E  R E S E A R C H  I N S T I T U T E  N E T H E R L A N D S
//----------------------------------------------------------------------------
// Copyright (C) 2012 - MARIN - All rights reserved - http://www.marin.nl
//----------------------------------------------------------------------------
// Program    : mermaid
// Module     : vbm
// File       : smoothzetaphi.h
// Author     : M.A. de Jong
//----------------------------------------------------------------------------

#ifndef SMOOTHZETAPHI_H
#define SMOOTHZETAPHI_H

#include "kernels/smoothzetaphi_kernels.h"

namespace wavescomputer
{

template <class T>
inline void smoothzetaphi(T* dt_phi,
                          T* dt_zeta,
                          const T* dt_phim1,
                          const T* dt_zetam1,
                          const T eps,
                          const int nx, const int ny)
{
    dimGrid.x = nx / NUM_THREADS_X;
    dimGrid.y = ny / NUM_THREADS_Y;
    dimBlock.x = NUM_THREADS_X;
    dimBlock.y = NUM_THREADS_Y;
        
    kernel_smoothzetaphi<T> <<< dimGrid, dimBlock >>> 
        (dt_phi,   dt_zeta, 
         dt_phim1, dt_zetam1,
         eps, nx);

    checkCudaError(cudaGetLastError(), 
        "wavescomputer::kernel_smoothzetaphi");
}

} // namespace wavescomputer

#endif // SMOOTHZETAPHI_H

